Add callback test case.
Code cleanup.