Encapsulate the struct and function in a mod