fixed mostly bugs with the changed factory class