refactor config #13
add tests #12