Pulled out some common functions into a namespace called GameFunctions.