Minor refactorization and lint warning removal.