Added file type check
Added initial support to multiprocessing
Moved out