Better compliance to coding conventions, clean up, default logging added