Logging changed and made more coherent