refactored command arguments and typing