some code cleanup mainly for maintainability/readability
Merge branch 'code-cleanup'