refactor and cache all flot data