code review fixes and cleanup