export type t and move function to submodule for more clarty