added uri regex-based before() and after() callbacks