initial typing logic