Attempt to remove some duplication