add a lot of tests, and refresh function