Changed save and return logic, refactoring