Code cleanup

Name and code analysis changes.