code cleanup, suggestions from code review