First refactoring attempt.
second attempt for refactoring.
Include the unit main file program.