Avoiding brittleness by layering automation code