refactored controller, filesService