1: remove unittest.
2: pass function as argument.