Add allAction, refactor code