Representation, search, and the evolution of routines in problem solving