Improve regeneration logic and output