Optimization of bank portfolios