Refactore file model