refactor cor & test state