Changing to class to use logging.