Added support for 5 and 6 byte interger
Simplified code with common base class
Removed invalid assertion. Changed data type precedence