Refactored sorting methods to use custom weighting instead of a single attribute