More elegant manner of changing states