removed some unnecessary casting