Improved save management and made code more efficient