Moved logging logic to separate Logger object