optimize build rules