Move stashing to generating the html