Cosmetic refactorings, comments and TODOs.