diff --git a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetForwardingConstruct.java b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetForwardingConstruct.java
index c055837..6b20e4b 100644
--- a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetForwardingConstruct.java
+++ b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetForwardingConstruct.java
@@ -26,6 +26,8 @@
 import java.util.stream.Collectors;
 
 import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * Representation of a CE Forwarding Construct.
@@ -35,13 +37,13 @@
     private Set<CarrierEthernetLogicalTerminationPoint> ltpSet;
     private VlanId vlanId;
     private CarrierEthernetMetroConnectivity metroConnectivity;
-    private boolean congruentPaths;
+    private boolean congruentPaths = true;
     protected AtomicInteger refCount;
 
-    // Set to true if both directions should use the same path
-    private static final boolean CONGRUENT_PATHS = true;
-
-    // Note: fcId should be provided only when updating an existing FC
+    // TODO: Remove id from constructor - currently used only when updating FC
+    // TODO: Add congruentPaths flag to constructor and Builder
+    // TODO: Make constructor private when SCA/NRP API apps are migrated
+    @Deprecated
     public CarrierEthernetForwardingConstruct(String id, String cfgId, Type type,
                                               Set<CarrierEthernetLogicalTerminationPoint> ltpSet,
                                               Duration maxLatency) {
@@ -49,7 +51,6 @@
         this.ltpSet = new HashSet<>(ltpSet);
         this.vlanId = null;
         this.metroConnectivity = new CarrierEthernetMetroConnectivity(null, OpticalPathEvent.Type.PATH_REMOVED);
-        this.congruentPaths = CONGRUENT_PATHS;
         this.refCount = new AtomicInteger();
     }
 
@@ -94,9 +95,9 @@
     }
 
     /**
-     * Returns true if FC requires congruent paths.
+     * Returns true if FC requires that both directions should use the same path.
      *
-     * @return true if congruent paths required
+     * @return true if both directions should use the same path
      */
     public boolean congruentPaths() {
         return congruentPaths;
@@ -158,4 +159,95 @@
                 .add("refCount", refCount)
                 .add("LTPs", ltpSet).toString();
     }
+
+    /**
+     * Returns a new builder.
+     *
+     * @return new builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of CarrierEthernetForwardingConstruct entities.
+     */
+    public static final class Builder {
+
+        private String id;
+        private String cfgId;
+        private Type type;
+        private Duration maxLatency;
+        private Set<CarrierEthernetLogicalTerminationPoint> ltpSet;
+        private boolean congruentPaths;
+
+        /**
+         * Sets the id of this builder.
+         *
+         * @param id the builder id to set
+         * @return this builder instance
+         */
+        public Builder id(String id) {
+            this.id = id;
+            return this;
+        }
+
+        /**
+         * Sets the cfgId of this builder.
+         *
+         * @param cfgId the builder cfgId to set
+         * @return this builder instance
+         */
+        public Builder cfgId(String cfgId) {
+            this.cfgId = cfgId;
+            return this;
+        }
+
+        /**
+         * Sets the type of this builder.
+         *
+         * @param type the builder type to set
+         * @return this builder instance
+         */
+        public Builder type(Type type) {
+            this.type = type;
+            return this;
+        }
+
+        /**
+         * Sets the maxLatency of this builder.
+         *
+         * @param maxLatency the builder maxLatency to set
+         * @return this builder instance
+         */
+        public Builder maxLatency(Duration maxLatency) {
+            this.maxLatency = maxLatency;
+            return this;
+        }
+
+        /**
+         * Sets the ltpSet of this builder.
+         *
+         * @param ltpSet the builder ltpSet to set
+         * @return this builder instance
+         */
+        public Builder ltpSet(Set<CarrierEthernetLogicalTerminationPoint> ltpSet) {
+            this.ltpSet = ltpSet;
+            return this;
+        }
+
+        /**
+         * Builds a new CarrierEthernetForwardingConstruct instance.
+         * based on this builder's parameters
+         *
+         * @return a new CarrierEthernetForwardingConstruct instance
+         */
+        public CarrierEthernetForwardingConstruct build() {
+            checkNotNull(type, "FC must have a type");
+            checkArgument(ltpSet != null && ltpSet.size() > 1,
+                          "FC must include at least two LTPs");
+            return new CarrierEthernetForwardingConstruct(id, cfgId, type,
+                                                          ltpSet, maxLatency);
+        }
+    }
 }
diff --git a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetManager.java b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetManager.java
index 297deed..7aa4860 100644
--- a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetManager.java
+++ b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetManager.java
@@ -432,7 +432,10 @@
     CarrierEthernetForwardingConstruct fcFromEvc(CarrierEthernetVirtualConnection evc) {
         Set<CarrierEthernetLogicalTerminationPoint> ltpSet = new HashSet<>();
         evc.uniSet().forEach(uni -> ltpSet.add(new CarrierEthernetLogicalTerminationPoint(null, uni)));
-        return new CarrierEthernetForwardingConstruct(null, null, evc.type(), ltpSet, null);
+        return CarrierEthernetForwardingConstruct.builder()
+                .type(evc.type())
+                .ltpSet(ltpSet)
+                .build();
     }
 
     /**
@@ -582,23 +585,24 @@
         //////////////////////////////////////////////////////////////////////////////////
 
         ltpSetMap.values().stream().collect(Collectors.toSet()).forEach(ltpSet -> {
+            CarrierEthernetForwardingConstruct.Builder fcBuilder =
+                    CarrierEthernetForwardingConstruct.builder().ltpSet(ltpSet);
             // Type is determined by number and type of LTPs in each set
             CarrierEthernetVirtualConnection.Type fcType =
                     ltpSet.size() == 2 ? CarrierEthernetVirtualConnection.Type.POINT_TO_POINT
                             : CarrierEthernetConnection.Type.MULTIPOINT_TO_MULTIPOINT;
-            CarrierEthernetForwardingConstruct fc =
-                    new CarrierEthernetForwardingConstruct(null, null, null, ltpSet, null);
             // If one of the LTPs is LEAF, indicate FC as ROOT_MULTIPOINT
-            for (CarrierEthernetLogicalTerminationPoint ltp : fc.ltpSet()) {
+            for (CarrierEthernetLogicalTerminationPoint ltp : ltpSet) {
                 if (ltp.role().equals(CarrierEthernetLogicalTerminationPoint.Role.LEAF)) {
                     fcType = CarrierEthernetConnection.Type.ROOT_MULTIPOINT;
                     break;
                 }
             }
-            fc.setType(fcType);
-            fcSet.add(fc);
+            fcSet.add(fcBuilder.type(fcType).build());
             log.info("Created ForwardingConstruct comprising LogicalTerminationPoints {}",
-                    ltpSet.stream().map(ltp -> ltp.id()).collect(Collectors.toList()));
+                     ltpSet.stream()
+                             .map(CarrierEthernetLogicalTerminationPoint::id)
+                             .collect(Collectors.toList()));
         });
 
         return fcSet;
diff --git a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetVirtualConnection.java b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetVirtualConnection.java
index 0eed7f3..3b0de5f 100644
--- a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetVirtualConnection.java
+++ b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/app/CarrierEthernetVirtualConnection.java
@@ -22,6 +22,8 @@
 import java.time.Duration;
 
 import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * Representation of a Carrier Ethernet EVC.
@@ -37,12 +39,16 @@
     // Maximum possible number of UNIs for non-Point-to-Point EVCs
     public static final Integer MAX_NUM_UNI = 1000;
 
-    // Note: evcId should be provided only when updating an existing service
-    public CarrierEthernetVirtualConnection(String id, String cfgId, Type type, Integer maxNumUni,
+    // TODO: Remove id from constructor - currently used only when updating EVC
+    // TODO: Make constructor private when SCA/NRP API apps are migrated
+    @Deprecated
+    public CarrierEthernetVirtualConnection(String id, String cfgId, Type type,
+                                            Integer maxNumUni,
                                             Set<CarrierEthernetUni> uniSet,
                                             Duration maxLatency) {
         super(id, cfgId, type, maxLatency);
-        this.maxNumUni = (maxNumUni != null ? maxNumUni : (type.equals(Type.POINT_TO_POINT) ? 2 : MAX_NUM_UNI));
+        this.maxNumUni = maxNumUni != null ? maxNumUni :
+                type.equals(Type.POINT_TO_POINT) ? 2 : MAX_NUM_UNI;
         this.uniSet = new HashSet<>(uniSet);
         this.fcSet = new HashSet<>();
         this.shortId = null;
@@ -139,4 +145,107 @@
                 .add("UNIs", uniSet)
                 .add("FCs", fcSet).toString();
     }
+
+    /**
+     * Returns a new builder.
+     *
+     * @return new builder
+     */
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder of CarrierEthernetVirtualConnection entities.
+     */
+    public static final class Builder {
+
+        private String id;
+        private String cfgId;
+        private Type type;
+        private Duration maxLatency;
+        private Set<CarrierEthernetUni> uniSet;
+        private Integer maxNumUni;
+
+        /**
+         * Sets the id of this builder.
+         *
+         * @param id the builder id to set
+         * @return this builder instance
+         */
+        public Builder id(String id) {
+            this.id = id;
+            return this;
+        }
+
+        /**
+         * Sets the cfgId of this builder.
+         *
+         * @param cfgId the builder cfgId to set
+         * @return this builder instance
+         */
+        public Builder cfgId(String cfgId) {
+            this.cfgId = cfgId;
+            return this;
+        }
+
+        /**
+         * Sets the type of this builder.
+         *
+         * @param type the builder type to set
+         * @return this builder instance
+         */
+        public Builder type(Type type) {
+            this.type = type;
+            return this;
+        }
+
+        /**
+         * Sets the maxLatency of this builder.
+         *
+         * @param maxLatency the builder maxLatency to set
+         * @return this builder instance
+         */
+        public Builder maxLatency(Duration maxLatency) {
+            this.maxLatency = maxLatency;
+            return this;
+        }
+
+        /**
+         * Sets the uniSet of this builder.
+         *
+         * @param uniSet the builder uniSet to set
+         * @return this builder instance
+         */
+        public Builder uniSet(Set<CarrierEthernetUni> uniSet) {
+            this.uniSet = uniSet;
+            return this;
+        }
+
+        /**
+         * Sets the maxNumUni of this builder.
+         *
+         * @param maxNumUni the builder maxNumUni to set
+         * @return this builder instance
+         */
+        public Builder maxNumUni(Integer maxNumUni) {
+            this.maxNumUni = maxNumUni;
+            return this;
+        }
+
+        /**
+         * Builds a new CarrierEthernetVirtualConnection instance.
+         * based on this builder's parameters
+         *
+         * @return a new CarrierEthernetVirtualConnection instance
+         */
+        public CarrierEthernetVirtualConnection build() {
+            checkNotNull(type, "EVC must have a type");
+            checkArgument(uniSet != null && uniSet.size() > 1,
+                          "EVC must include at least two UNIs");
+            return new CarrierEthernetVirtualConnection(id, cfgId, type,
+                                                        maxNumUni, uniSet,
+                                                        maxLatency);
+        }
+    }
 }
diff --git a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateEvcCommand.java b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateEvcCommand.java
index a92fae6..f0ffff4 100644
--- a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateEvcCommand.java
+++ b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateEvcCommand.java
@@ -75,13 +75,14 @@
 
     @Override
     protected void execute() {
-
         CarrierEthernetManager ceManager = get(CarrierEthernetManager.class);
-
-        CarrierEthernetVirtualConnection evc = new CarrierEthernetVirtualConnection(argEvcId, argEvcCfgId,
-                generateEvcType(), generateMaxNumUni(), generateUniSet(), null);
-
-        ceManager.installEvc(evc);
+        ceManager.installEvc(CarrierEthernetVirtualConnection.builder()
+                                     .id(argEvcId)
+                                     .cfgId(argEvcCfgId)
+                                     .type(generateEvcType())
+                                     .maxNumUni(generateMaxNumUni())
+                                     .uniSet(generateUniSet())
+                                     .build());
     }
 
     /**
diff --git a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateFcCommand.java b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateFcCommand.java
index 0a2e6f3..2b42195 100644
--- a/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateFcCommand.java
+++ b/ecord/carrierethernet/src/main/java/org/onosproject/ecord/carrierethernet/cli/commands/CarrierEthernetCreateFcCommand.java
@@ -72,13 +72,13 @@
 
     @Override
     protected void execute() {
-
         CarrierEthernetManager ceManager = get(CarrierEthernetManager.class);
-
-        CarrierEthernetForwardingConstruct fc = new CarrierEthernetForwardingConstruct(argFcId, argFcCfgId,
-                generateServiceType(), generateLtpSet(), null);
-
-        ceManager.installFc(fc);
+        ceManager.installFc(CarrierEthernetForwardingConstruct.builder()
+                                    .id(argFcId)
+                                    .cfgId(argFcCfgId)
+                                    .type(generateServiceType())
+                                    .ltpSet(generateLtpSet())
+                                    .build());
     }
 
     /**
