refactored queue code, introducing Manifest class