Rewrote new datatypes and add base factory