Minor refactorings, code format.