Remove DI files, as they are not needed at the moment
Change dependencies
Replace POSIX function through PCRE one
Extract function in for-loop to variable