optimaze a code of chartbuilder files