Restructured logging to use an own class