Code cleanance

improved and cleaned code