Implemented stub factory.