Replaced inplementation for integer types conversions
Cleanup and comments