Created a trait to hide some of the logic behind = neater API.