split the main c++ file into parts to avoid confusion