Cleanup and add filetype specific loading