refactor per recommendation of techhat