final refactoring for now