Updates to CommonLogic

Unit test and common logic