Small UPF refactoring