remove unnecessary struct build_context
move build_result to new public header