Finished minor refactorings