WeaponProjectile: refactor some duplicated code