Extracted this class as well, but didn't use it in the end.