Minor optimization / refactoring.