Extract common setup