Refactoring several classes