mega refactoring of classes and some fixes