backup before massive refactoring
Refactoring ; segfault (ptr dereferencing)