Simplify mirror selection and improve ranking of mirrors

This commit should also remove some weird corner cases as well.