further tidying up, moved common database calls to 'DatabaseUtilities'