Refactor

Another refactor cycle. I'm a bit tired of this all... I will continue with this refactoring branch until the software is stable and always merge between this one and master.