minor refactorings to parameter ordering