Implement before & after hooks