Refactor from Ryan's feedback