removing typecasts, making stuff sane