Making main.cpp smaller