moved tests to live with src, small refactor