Tiny refactorings
Updated version