Adapted to official flowgrind coding style