refactoring typer