Add before/after hooks