Refactor options. Thans @gnugat.