Several improvements based on Code Climate input.