Minor additions and refactorings