Factory pattern commit