minor clean up
add some tests