Refactor and change to properties
Flush stdout to display in real time