This reorganization makes the code more modular and makes it easier to identify and fix possible errors in the future.