Reworks the state system to cut down on code redundancy