Caching some values to avoid heavy computation.