Organized game and chat js codes