Extract db layer into repository. Rename user_sign_in_type