move monadic version to internal