minor refactor
add a test