refactored code. gave graphview attrs