Moved logging to its own module