Refactored parse/rewrite somewhat