factory and interface examples