split constructor code and 'as' implementation into type/bool.h and so on.