GUI fix + small rewrite