Are you suggesting something like this?
def createUesr(db):
if db is type1:
behaviour1
if db is type2:
behaviour2