Refactoring of some classes