Refactor UI

Added some UI elements as well as refactored how sorting occurs in view.