small refactoring, adding procedures for freeing tree and adding node above