cleaning up typecast