code review & cleanup