Files architecture reorganized + open and close added with verification of length for more security