refactored some methods
Merge branch 'master' into staging