minor refactoring to correctly set options