optimize frontend performance