cleanup & write better tests
update the build