Further separations of functions within main.js