modify options.
refactory code.