refactor meta data build process