refactor to basic state