Refactoring of classes