better handling of opts