Refactoring of get_top_submissions