Refactoring & reformatted output