working with Media plugin as separate functions