refactoring, moving code around