code cleaning up and unit test