pulls out a function for relative clarity