improved spec for classes