profile: simplify and make mosml work