refactored option match