improve user and tree database operation