few fixes and starting refactoring
Merge remote-tracking branch 'origin/master'