cleanup: Add constants, tweak comments, improve readability