Extract commonalities into helper file