Rewrite and modularise
thumbs