Turn resource controller identification into a method instead of check the class hierarchy