Design for cognitive flexibility in learning