Also, it may be a good idea to refactor the Optopts filtering into its own function. [optional]