Refine unit testing