Refactoring for namespaces.
Adding Huffman encoding