class system rewrite