Also, maybe move this class to utils.py?