Changed the organization of option parsing