Some boilerplate code to adapt