change state to props and combined state transformation into a single underlying call