Cleaned up code to use game object