clean up code for review #2761