Remove opts variable

- Removed the opts variable. It is not used outside initOpts.
- Moved initOpts function to be inside the variable watcher.