Code review changes from Dimitri