Style clean btformats, refactor type checking into functions