Refactoring & add some opts