Small refactoring.

SD-246 : Integrate ElasticSearch for media files search

Small refactoring.