Try to remove some duplication