refactoring code not completed: moving stuff