can we not generate this somewhere in session globally so we don't have all this duplication?