add color change to lines on rollover and refactoring