Refactor, putting class out of R specific assembly.