Refactoring for table definitions to make it yet more monadic