Refactoring PHP code.