Implement DB relationships; Fix registration bug; remove unused and comments