This function and it's cohorts might be distinct enough to warrant a separate module...