Some refactoring to make code more clear
Some refactoring more...
Merge origin/master