I'm sorry for being that guy, but I'm not totally sure what you need... Is it the code itself you want cleaned up or the presentation when it displays on a website?
For the code itself, honestly, I say let it be sloppy; it's not really made to be aesthetic but functional, so if the game runs right, I'd just leave it alone. Most people aren't going to look at the code, anyway.
If the game isn't running right, we can probably help more with that, but if that's the case, I don't know what's not working and would need some more information. I see you're running it on itch.io, so it's possible that part of the problem you're experiencing is just their containing frame; that could be resolved by hosting it independently, but there isn't much to be done about it otherwise.
I know I didn't offer much of a resolution for you, but feel free to update us with any other insight and I'm sure the community here will be happy to help in any way we can.