Add new functions to Type module and restructure it.