Some changes to controller logic to make more clear states