Updating for code style and minor refactoring.