fix bug: lib should return instance of one of input's possible forms