refactored isOptionOf
some more refactoring, removing spurious ifs (ones that return)