changes and code improvment