Made sure there are no excessive newlines, added more locations of locking, created generic package generator