Updated code for using Interfaces instead of Classes