Added support for log

But also made a very little cleaning