giant refactoring & make saving of almost all data work