Partial updates + refactoring of makeTree code