mass code refactoring