Cleaner version of the ranking functions