Added more commands and moved code out