Minor Refactoring and Tweaks