Extract common code into includes