Find pages by custom slug

Can we refactor this and the other slug validation method?