Notable optimization and couple of fixes to retain code consistency