refactoring some classes to ease to maintain