last changes - bugs fixed and some classes where refactored