further common code extraction