Reworked types into modules