some refactoring and introducing HTTP log