add tests / move functional testing