enhanced some code