another quick refactor