Removed exception declaration in factory method.