Fixes a couple of issues by using interfaces rather than a specific implementation