Tidy up some code and move Weighting OrderBy