Finalizing and cleaning code.