moved save method to higher level