more pretty code refactoring