refactor db for ease of use and registration routing