Refactor some redundancy out