fix unit tests + cleanup