Please pack that code into a separate method given that it exists three times in that file now.