Pattrens in C: simple-factory