Todo: replace log with stdlib logging.