Made save goal function a bit more compact.