Added gridview refresh code, general cleaning

Adding code to refresh the gridview, to take into account deletions or
movements that may have occured since the grid was last populated.
General cleaning up of code, simplifying and replacing where needed