Refactoring a couple of classes