Cleaned up the code for managing the portfolio/benchmark state