refactor options and add two-level
merge changes