Some more cleanup and refactoring adjustments