a lot of refactoring stuff
jodu