core: improved main class detection
ui: improved overflow handling