diff --git a/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/TransactionManager.java b/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/TransactionManager.java
index c401586..c05431a 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/TransactionManager.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/common/transaction/mngr/TransactionManager.java
@@ -20,14 +20,13 @@
 
 package org.openecomp.sdc.common.transaction.mngr;
 
-import java.util.List;
+import java.util.Queue;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.annotation.Resource;
 
 import org.openecomp.sdc.be.dao.impl.ESCatalogDAO;
 import org.openecomp.sdc.be.dao.titan.TitanGenericDao;
-import org.openecomp.sdc.common.datastructure.CapList;
 import org.openecomp.sdc.common.transaction.api.ITransactionSdnc;
 import org.openecomp.sdc.common.transaction.api.TransactionUtils;
 import org.openecomp.sdc.common.transaction.api.TransactionUtils.ActionTypeEnum;
@@ -35,6 +34,9 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
+import com.google.common.collect.EvictingQueue;
+import com.google.common.collect.Queues;
+
 @Component("transactionManager")
 public class TransactionManager {
 
@@ -42,7 +44,7 @@
 
 	private AtomicInteger transactionIDCounter = new AtomicInteger(0);
 
-	private List<ITransactionSdnc> transactions;
+	private Queue<ITransactionSdnc> transactions;
 	@Resource
 	private ESCatalogDAO esCatalogDao;
 	@Resource
@@ -91,7 +93,10 @@
 	private synchronized void init() {
 		if (transactions == null) {
 			log.info("TransactionManager Initialized");
-			transactions = new CapList<>(TransactionUtils.MAX_SIZE_TRANSACTION_LIST);
+			EvictingQueue<ITransactionSdnc> queue = EvictingQueue
+					.<ITransactionSdnc>create(TransactionUtils.MAX_SIZE_TRANSACTION_LIST);
+			// make thread-safe
+			transactions = Queues.synchronizedQueue(queue);
 		}
 	}
 
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/datastructure/CapList.java b/common-app-api/src/main/java/org/openecomp/sdc/common/datastructure/CapList.java
deleted file mode 100644
index d202715..0000000
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/datastructure/CapList.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.common.datastructure;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-/**
- * Thread Safe List with a cap for Max elements.<br>
- * If an element would be inserted to the list and it is full, the oldest
- * element will be taken out.
- * 
- * @author mshitrit
- *
- * @param <T>
- */
-public class CapList<T> implements List<T> {
-	private static final int DEFAULT_CAP = 1000;
-	private int cap;
-	private ReadWriteLock readWriteLock;
-	private List<T> innerList;
-
-	public CapList() {
-		this(DEFAULT_CAP);
-	}
-
-	public CapList(int cap) {
-		if (cap < 1) {
-			throw new RuntimeException("List Cap Must Be Positive");
-		}
-		this.cap = cap;
-		innerList = new ArrayList<>();
-		readWriteLock = new ReentrantReadWriteLock();
-	}
-
-	@Override
-	public boolean add(T e) {
-		try {
-			readWriteLock.writeLock().lock();
-			boolean result = innerList.add(e);
-			removeExtras();
-			return result;
-
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-
-	}
-
-	private void removeExtras() {
-		while (innerList.size() > cap) {
-			innerList.remove(0);
-		}
-	}
-
-	@Override
-	public void add(int index, T element) {
-		try {
-			readWriteLock.writeLock().lock();
-			innerList.add(index, element);
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-
-	}
-
-	@Override
-	public boolean addAll(Collection<? extends T> c) {
-		try {
-			readWriteLock.writeLock().lock();
-			boolean result = innerList.addAll(c);
-			removeExtras();
-			return result;
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public boolean addAll(int index, Collection<? extends T> c) {
-		try {
-			readWriteLock.writeLock().lock();
-			boolean result = innerList.addAll(index, c);
-			removeExtras();
-			return result;
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public void clear() {
-		try {
-			readWriteLock.writeLock().lock();
-			innerList.clear();
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-
-	}
-
-	@Override
-	public boolean contains(Object o) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.contains(o);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-
-	}
-
-	@Override
-	public boolean containsAll(Collection<?> c) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.containsAll(c);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public T get(int index) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.get(index);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public int indexOf(Object o) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.indexOf(o);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public boolean isEmpty() {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.isEmpty();
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public Iterator<T> iterator() {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.iterator();
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public int lastIndexOf(Object o) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.lastIndexOf(o);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public ListIterator<T> listIterator() {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.listIterator();
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public ListIterator<T> listIterator(int index) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.listIterator(index);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public boolean remove(Object o) {
-		try {
-			readWriteLock.writeLock().lock();
-			return innerList.remove(o);
-
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public T remove(int index) {
-		try {
-			readWriteLock.writeLock().lock();
-			return innerList.remove(index);
-
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public boolean removeAll(Collection<?> c) {
-		try {
-			readWriteLock.writeLock().lock();
-			return innerList.removeAll(c);
-
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public boolean retainAll(Collection<?> c) {
-		try {
-			readWriteLock.writeLock().lock();
-			return innerList.retainAll(c);
-
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public T set(int index, T element) {
-		try {
-			readWriteLock.writeLock().lock();
-			return innerList.set(index, element);
-
-		} finally {
-			readWriteLock.writeLock().unlock();
-		}
-	}
-
-	@Override
-	public int size() {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.size();
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public List<T> subList(int fromIndex, int toIndex) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.subList(fromIndex, toIndex);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public Object[] toArray() {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.toArray();
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-	@Override
-	public <T> T[] toArray(T[] a) {
-		try {
-			readWriteLock.readLock().lock();
-			return innerList.toArray(a);
-
-		} finally {
-			readWriteLock.readLock().unlock();
-		}
-	}
-
-}
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/data_structure/CapListTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/data_structure/CapListTest.java
deleted file mode 100644
index 7aeb2ac..0000000
--- a/common-app-api/src/test/java/org/openecomp/sdc/common/data_structure/CapListTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.common.data_structure;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.junit.Test;
-import org.openecomp.sdc.common.datastructure.CapList;
-
-public class CapListTest {
-	public enum LIST_ACTION {
-		Add, Remove, Size, Get
-	}
-
-	@Test
-	public void testCap() {
-		List<Integer> testList = new CapList<>(10);
-		for (int i = 0; i < 100; i++) {
-			testList.add(i);
-		}
-		assertTrue(testList.size() == 10);
-		for (int i = 0; i < testList.size(); i++) {
-			assertTrue(testList.get(i) == (i + 90));
-		}
-	}
-
-	@Test
-	public void testThreadSafe() {
-		List<Integer> testList = new CapList<>(1000);
-
-		ExecutorService executor = Executors.newFixedThreadPool(4);
-		for (int i = 0; i < 10; i++) {
-			Runnable worker;
-			// 0 - 4
-			if (i < 5) {
-				worker = new ThreadWorker(i, LIST_ACTION.Add, testList);
-			}
-			// 5, 8
-			else if (i == 5 || i == 8) {
-				worker = new ThreadWorker(i, LIST_ACTION.Remove, testList);
-			}
-			// 6
-			else if (i == 6) {
-				worker = new ThreadWorker(i, LIST_ACTION.Size, testList);
-			}
-			// 7, 9
-			else {
-				worker = new ThreadWorker(i, LIST_ACTION.Get, testList);
-			}
-			executor.execute(worker);
-		}
-		executor.shutdown();
-		while (!executor.isTerminated()) {
-		}
-		assertTrue(testList.size() == 60);
-	}
-
-	public static class ThreadWorker implements Runnable {
-		private LIST_ACTION action;
-		private List<Integer> list;
-		private Integer id;
-
-		ThreadWorker(Integer id, LIST_ACTION action, List<Integer> list) {
-			this.action = action;
-			this.list = list;
-			this.id = id;
-		}
-
-		@Override
-		public void run() {
-			for (int i = 0; i < 20; i++) {
-				threadNap();
-				switch (action) {
-				case Add:
-					list.add(id * 100 + i);
-					break;
-				case Remove: {
-					int index = (int) (Math.random() * 10);
-					list.remove(index);
-					break;
-				}
-				case Get:
-					int index = (int) (Math.random() * 10);
-					Integer integer = list.get(index);
-
-					break;
-				case Size:
-					int size = list.size();
-					break;
-				}
-			}
-
-		}
-
-		private void threadNap() {
-			long napTime = (long) (Math.random() * 100);
-			try {
-				Thread.sleep(napTime);
-			} catch (InterruptedException e) {
-				e.printStackTrace();
-			}
-		}
-	}
-}
