Code clean up + style upgrade