Refactored add and save into single function (tests broken)