improve code via https://github.com/L2Program/FlintPlusPlus