Added test cases for the common objects and refactored code.