Minor refactorings and GEMFILE updates.