Add additional logging and perform refactoring for command line arguments processing