What techniques did you use to refactor legacy PHP code, and what improvements did you observe post-refactoring?

Experience