Finalizing functionality.