moved code
more refactoring
more refactoring
more refactoring