code cleaning. UML diagram added