refactor and read body from file