The artist and album objects are built as stdClass instances in different places, wouldn't be more efficient to have 2 factory methds or use real classes with constructors?

Either would avoid the code duplication and lower the chances of inconsistency between object creations in different places.