Split out some more functionality