minor code style cleanup and performance considerations