refactoring, more options added