massive refactoring of the code, improving of many aareas