reorganize types (closes #17)