Added refactoring on last action and its test