shorten spec logic for classes