We describe the explicit construction of the smallest gauge invariant classes of tree Feynman diagrams in gauge theories. We demonstrate on several examples that splitting of all contributed diagrams on the exact gauge invariant subclasses may lead to nontrivial physical conclusions and to a significant simplification of calculations. Applications for automatic computations in high energy particle physics are discussed.