Got rid of duplicate code; Made getData static