Small refactor for Level order traversal