clean up user comments code and added tests for it