abstracting out more common code