refactor:remove type switch