DRY'ed up select statement