rewrite build rules