added link to docs for process
extract logic into sub functions
formatting