use Rails provide helper to prevent code duplications.