return type of portable factory is changed to auto_ptr<Portable>. Code revising coninues to fix returning local references and pointers