Refactor and clean up. Use fell for logging.