begin splitting main.c