Cleanup of MLS R code