Code tidy and var change
Code tidy