refactor node and tree to be fully seperated