Refactored supertypes calculation for clarity