Improve comments and test cases