Refactoring some code into Actions module