Code clean up with comments