refactors dom Template to create and remove the temp container every time