this probably makes a lot of sense, even without the rest of the patch. Factoring this into a single function for sync and async directives would be a plus