Refactored common rewrite structure of rewriting non-functions.