refactor the methods and add options.