On applications of Szemerédi's regularity lemma