Simplify profile rewrite rules. See #4