all the refactoring