Refactor Command menu