rf/brk: major refactor to clean up directory. Not tested yet