refactoring add func in action.py