refactoring: not finished yet