Export symbols
Factorize code
Use global vars
Simplify global argument parsing
Simplify consume-option call.