Foreach logic duplicated

Created a private method to eliminate duplicate code in the setGetValue and setPostValue methods...figured I'd try one more time :P