refactor man command