I've refactored the code to remove this redundency