Refactor amy chart