split cmd.cpp in different files