Modify according to code review from Jun