Refactored option parsing into separate file.