SmartyPants optimization (part 2)