Simplify implementation

Simplified contructors. There is no problem with the TypedArray. You can sse codeSample for example, it can't be null.
Simplified general implementation.