Jazz improvisation to me is like programming; the refactoring of existing themes, and the introduction of new features, under time pressure.
Here's a concept from 19th century music that seems connected to the question of thematic refactoring/development: https://en.wikipedia.org/wiki/Thematic_transformation