Refactor to prettify output and pave the way for Windows