DRY code
DRY code

There was a really useful comment left in the pr which suggested some
ways to dry up the code. This pr implements some of those suggestions.

ministryofjustice/prison-visits-public,ministryofjustice/prison-visits-public,ministryofjustice/prison-visits-public,ministryofjustice/prison-visits-public