complete refactoring again