getting rid of unncessary cast