Changed the way states are parsed from objects