Simplifying some of the .val() test code.