Fleshed out most of the class and factory