start of refactoring
more refactoring