Yes, too many variables but you can try these steps for each of the concerns :-
1) Use rain water / well water - free from chlorine. If you only have water from the tap, use the chlorine neutralizer (available from pets shop). if you can't get chlorine neutralizer, leave the water in your tank exposed overnight + a small tea spoon of salt into the tap water, the salt will neutralize the chlorine.
2) Fish are sensitive to the water pH changes. Like what other have alerted, when introduce the fish into the tank, pour the water in the bag into the tank as well, the practice will normalize the pH level of the fish tank so that the change of the water pH is not significant until it causes stress to the fish.
3) When changing the water inside the fish tank, change only 1/2 or 2/3 of the water with the new water, this will preserve the pH level fluctuation so that it won't stress up the fish.
4) Oxygen level in the water, you need the an aerator to regulate the oxygen level in the water. If you don't have this, use water based plant as the substitute. The water based plant can introduce the oxygen into the water & at the same time absorb the ammonia level of the water.
5) Avoid using back the water with the dead fish, it was contaminated with the bacteria already.
Is it good idea to use filter water instead of tap water to ensure no chlorine? I use cuckoo brand