Some refactoring for action