`menu` and `stats` two globals - consider separating this logic into two files (good practice - one file/ module does one thing, same as classes in PHP)