add logger.  refactor test