Custom morgan config and some refactoring.