Refactoring of classes and methods. Added validation of application settings.