Extract the functions of command from main.c and add new file named command.c