code refactoring in all php scripts