added process to strip out directive names and type