various refactorings  & schema change fix at ordinal mapping