Simplified code. Removed useless Cache class
Implemented base code for unpacking