library ProxyFactory {
    /* functions */

    function _create(address logic, bytes memory data) internal returns (address proxy) {
        // deploy clone
        proxy = Clones.clone(logic);

        // attempt initialization
        if (data.length > 0) {
            (bool success, bytes memory err) = proxy.call(data);
            require(success, string(err));
        }

        // explicit return
        return proxy;
    }

    function _create2(
        address logic,
        bytes memory data,
        bytes32 salt
    ) internal returns (address proxy) {
        // deploy clone
        proxy = Clones.cloneDeterministic(logic, salt);

        // attempt initialization
        if (data.length > 0) {
            (bool success, bytes memory err) = proxy.call(data);
            require(success, string(err));
        }

        // explicit return
        return proxy;
    }
}
function _create(address logic, bytes memory data) internal returns (address proxy) {
    // deploy clone
    proxy = Clones.clone(logic);

    // attempt initialization
    if (data.length > 0) {
        (bool success, bytes memory err) = proxy.call(data);
        require(success, string(err));
    }

    // explicit return
    return proxy;
}

/* functions */