Implement an interface pattern.

Thanks to @euantorano for suggesting this one.