small cleanup no need to read state twice
hlint police