Deep extend with customizable behavior.