Completed minor refactoring and code audit.