Changed a process intensive function to be lighter on the server side.