Move updating to its own file