Big refactoring.
- created factory methods
- splited code
Refactored creation of classmap.