Lots of refactoring done today