Improved helper to avoid errors