seperate utils and update map code