Updates the code to use the type functions