lots of refactoring
lots of refactoring