Minor refactoring for last.