Refactoring sort dialog code to be able to implement easier a gnome