Refactored option handling