refactored per code review 9/10