Added type hint for closure