Updated code to better code style.