more test on constant
add some comments and refactor