In #169 I've created a helper class for this so I'll just update it to use that once it merges.