create an inner functional interface to handle rebuild() in rebuildAll()