Stronger typing for formatters with the help of generics. Separate format and serial data type. (#548)