More refactoring. Abstracted out the caching and rendering now so should be able to generalise different shapes. Will probably do it a little bit more...