Code refactoring
Save/load base function added