modify #if...#endif fold syntax; remove some useless function