More refactoring of common code