refactored a bit
created new classes and refactored