moved casting into method call parameter