TST: add tests + code cleanup