* nit * GeneralUtils const-correctness and minor fixes * use copy instead of reference for char iteration loops * fix typo and reorganize some functions