Move functions to shared shell_functions