Refactor some of the base command stuff