Add dynaic before/after hooks