I wonder if we cant change all of this into a snippet