Moved ModelFactory and User code