code review comments: clean up checkSafe and add some comments