Minor fixes

Better structure and some comments