Minor refactorings. rename token. cleanup if/else.