Cleanup of lots of code
finish refactor