Refactored file code to reduce duplication.
Added a class for controlling access to "config.properties".