-BUGFIX: improved the class and type constructor