Lots of new features/refactor