Updated code style according to Patrick's comments