rewrite to support minification