Externalized the needed functions.