Core sorting logic moved in separate method so that it could be called directly from user code, method for removal of sortclicking