Refactored optimizer argument processing