All these type-specific things should go to their respective classes instead of here.