refactor function_def.py