Refactor RpsDb class

Extract classes from RpsDb.