Turned map update into its own function