Implement iterator helper functions