Survey save done and some refactoring done.