Extract common code into Base