Refactored command line part.