refactored based on feedback from Clint

refactored based on feedback from Clint