Finalizing and cleaning up code.