Factorized some duplicated code in Front.