refactor and comment bestfirstplayer