refactored claims parsing to make expanding claims easier and more secure