refactor, get file type for future usage