Big Refactoring. UI separation

Some bugs are waiting for fixes