change order from ransack to manual(saves the state of sorting between requests) & some refactoring