improve memory usage when parsing options