Moved metadata lookup from controller to metadata helper