refactored the calculations of a character