refactor model
refactor gui
finish frame management