minor refactoring
+sort by button