Comments and small refactoring