u/danielw/dm-1395

Creating PR for reviewing DM-1395
Factored into a one-line function to reduce line length.