Common error and common functions
Rewrote factory to bring in classes from base set.