improved performance by reducing on java maps