Fix main interface loading
Fixed settings storing

also did some code imrovement