more flexible rebuild