Refactor to use interfaces in a better way.