Remove duplicate map code