added failed to save exception, removed some unnecessary test and some refactoring