simple class compatibility checking logic