refactor mithril app