Add trimming function
Refactor: use the same inerface of Actions
Merge pull request #357 from otiai10/wip/refactor

Wip/refactor