refactoring to clean code with TM