refactored some methods
Merge branch 'patch'