Directive made generic. Still needs some changes