Indentation of code, pre-check before starting logging and refactoring
of test class.