Replace the map with four explicit function bodies.