Improved grid extraction