Change apply method with idFunction to withId method to avoid ambiguous overload issues.