lots of stuff
small fixes
refactor