Moved packaging code to the top of the file.