Refactoring and adding classes