Rewrite to use interfaces