moving control logic for graphview into separate class