This is an initial implementation based on the current RD implementation Performance will improve later