Slim down main.cpp