loads more refactoring
a lot to go...