optimized query in the getOptions method