lick (or knock or whip) someone or something into shape act forcefully to bring someone or something into a fitter, more efficient, or better-organized state.
☞ This expression originally referred to the belief, expressed in some early bestiaries, that bear cubs were born as formless lumps and were literally licked into shape by their mother. A bestiary was a treatise about different types of animal, popular especially in medieval times.