Cleaned up states objects to remove name attribute dependence.