Pass context to helper function