polishing refactorings of the code