update some if statements for clarity and support for empty opts fields