trying to finish refactoring