Use common logic for checking singleton class for def self.x