move some calculations off the server and onto the client