minor refatcoring, removeed dead code