Hygiene: Refactor complicate variables into functions

Change-Id: I48b1d8a269d87f9a20129ab10b6c4edbf444d41d
Merge "Hygiene: Refactor complicate variables into functions"