Using defined types for cell contents.
A bit of refactoring / restructuring to make code more easily navigable.