Add base functions to work with RewriteMode