even more restructuring and new sample debug query (takes 5sec on my developer maschine...)