Make directive more reusable