Refactor score bucket sort api