DRYed up path for key logic