refactoring
support -o option