cleaned a little bit more code