move update code to a command