Refactoring

Extract common classes