Refactor LevelOrderTraverse