In order to make the code easier to maintain and port, refactor parts of the code into several files and functions.
In order to make the code easier to maintain and port, refactor parts of the code into several files and functions.