Optimized the search thanks to the DatabaseResult class