moved file reader functions from inline to regular object