almost fixed 3-level entities generation