This function can be changed if need be but i extracted it out this way so it can be changed easier.