breakdown the main file into smaller classes and add proper logger