Improve dfs layout