clean up code

fix #1