Small refactoring in protein matrix calculation cases 
almost finished.