Did some minor refactoring
Merge branch 'refactoring'