start making this more object oriented
more refactoring