a few unit tests + removed unnecessary code