optimize classification tree creation

do not query services collection repeatedly, instead load all of them
in a single dict.