Some refactorings, added menu bar.