Add unit testing and implement merge mechanism.