refactoring using things