Code improvements

comment and code layout improvements