Refactored parts of code
Merge remote-tracking branch 'origin/master'