same as file reader but with spring config