Code tidy and comment