Refactor states to use named views correctly