Minor refactoring, cleaning up.