Some more minor refactoring that was found with refactoring the demo.