move types to lib