Refactored code

new service for reading files
service in its own file
plugin in its own file