For now, a partial rewrite of remix