Fixing names and refactoring