Rewrite window_thumble into functional style