code reorganization: moved constants to Game object and changed a function to method