Description
The getProjectStage in our impl is suboptimal performancewise because it is implemented purely functional. But our implementation is an imperative singleton, so we can apply the singleton pattern to the method as well and safe the state after the first determination for future access. This should save us a little bit of time because we do not have to parse the script tags every time.
Also the 4 == in the if are slower than a direct map lookup. The code becomes tighter that way as well.