Code cleanup after self code review