fix typo in readme
move logic to separate package for testsing
add test