We want to use this function from multiple atoms so this patch moves it out to its own module for NAS-related helper functions.