code clean up
Close #1