make rewriting urls with formats better