Rename variables to aid code searching
Updated constants to have a more meaningful name
Updated more variable names, and prepare for loopifying the flags code