Separate shell code from main.c