Constructor with private closure