refactor goupConditions directive with compile function