refactor and make a prettier output page