Remove type.go and move types to where they're used