Merged code in Template::Hash into Template::Twostep