Refactor rvm