refactor body build process