added file:close and refractored accesibility