Don't retrieve values for invalid names
Move the test for name validity into it's own method.