refactor misc commands