filtering empty classes or roles