better handling of options