moved condition before/after hooks to action method