moved the b64encode to build_simple()