contract CDPerFactory {
    event Created(address indexed sender, address cdper);
    mapping(address=>bool) public isCDPer;

    // deploys a new CDPer instance
    // sets owner of CDPer to caller
    function build() public returns (CDPer cdper) {
        cdper = build(msg.sender);
    }

    // deploys a new CDPer instance
    // sets custom owner of CDPer
    function build(address owner) public returns (CDPer cdper) {
        cdper = new CDPer();
        emit Created(owner, address(cdper));
        cdper.setOwner(owner);
        isCDPer[cdper] = true;
    }
}
function build() public returns (CDPer cdper) {
    cdper = build(msg.sender);
}

// deploys a new CDPer instance
// sets owner of CDPer to caller