to switch some more things over to functions