now uses proper interface instead of type