minor cleanup with static casting