Fixed previous commit, reordered collection retrieval to optimize a bit the run-time