Separated treatment of selection and weighting.