add Dynamic ClassFactory and Tests