Close files after usage, change placement of config file