cleanup, refactoring part 2