Quick cleanup

I organized and refined various bits of the code; hope it helps! :palm_tree: