can you include again that we also parse the type from the filename. This can be after the if condition