- refactor based on drewman's comments