refactor alternate_caps method