change code oganization and support some arguments