More filetype code moved out into separate files