contract PaymentAddressFactory is Factory {
    // index of created contracts
    mapping (bytes4 => address) public paymentAddresses;

    function PaymentAddressFactory() public Factory("1.0.0") {}

    // deploy a new contract
    function newPaymentAddress(address _collector, bytes4 _identifier)
        public
        returns(address newContract)
    {
        require(paymentAddresses[_identifier] == address(0x0));
        PaymentAddress paymentAddress = new PaymentAddress(_collector, _identifier);
        paymentAddresses[_identifier] = paymentAddress;
        addContract(paymentAddress);
        return paymentAddress;
    }
}
function newPaymentAddress(address _collector, bytes4 _identifier)
    public
    returns(address newContract)
{
    require(paymentAddresses[_identifier] == address(0x0));
    PaymentAddress paymentAddress = new PaymentAddress(_collector, _identifier);
    paymentAddresses[_identifier] = paymentAddress;
    addContract(paymentAddress);
    return paymentAddress;
}

// deploy a new contract