Separated utility functions from Game.js into GameUtil.js