Avoid GWT depedency by bringing simplified dir estimate logic