Split the gereal functions into the main.js