fixed unfinished refactoring