Moving graphs feature code to frontend part