COde refactoring