refactor filehandler to remove unnecessary additional scope
can now read all existing database data