some changes in type casting and parsing