Mapper.build_tree for safe build