Refactor here document