refactor filesController