Refactoring of character.cs file