Move logic to command