Final fixes and refactoring