Function: minor refactorings