CharactersController refactoring and tests