improve options handling