Refactoring and lighter logging.