rf: major refactor