make directive more flexible