moved some functions from command -> command_sub