Pulled the logging method into a separate class