Refactor to Remove Duplication