Updated the serialize signature chain and refactored codes as suggested.