Refactor for DRYness