Refactored some file and container methods