common code moved into generic methods