refactored some of the stat/portrait code