Removing unneded typecasting