some refactoring for actions.py and rewrite check_type in future