refactored injectable to use polymorphism for objects and arrays