Renamed status to state, and some fix around