fully refactored with base classes, entities, factory logger;