Minimize object count when using gem