Refactoring node swap a little