Code clean up to merge into master branch.