reorganise size inference section; remove runtime checks subsec; clean up