refactored FileController