Small refactorings/cleanups