More logging & code formatting