Improve line breaks and ternary operators

Signed-off-by: Kaustav Das Modak <kaustav.dasmodak@yahoo.co.in>
Convert debugMode checks to multiline and fix indentation

Signed-off-by: Kaustav Das Modak <kaustav.dasmodak@yahoo.co.in>