Code cleanup/refactoring (Rubocop FTW).